# -*- coding: utf-8 -*-


'''
@Time    : 2020/2/18 10:43
@Author  : Chen Liu
@FileName: missing_value.py
@Software: PyCharm
'''

# 缺失数字
# 转化为只出现一次的数字


class Solution:
    def missingNumber(self, nums):
        res = 0
        for i, j in enumerate(nums):
            res ^= i ^ j
        res ^= len(nums)
        return res
